import control  # pip install control
import matplotlib.pyplot as plt
import math
import numpy as np


Ka = 6000
X=[]
Y=[]
for Ka in range(1,5000,10):
    # sys = control.tf([1],[1/5000,1020/5000,20000/5000,0]) #open loop
    sys = control.tf([5000*Ka],[1,1020,20000,5000*Ka]) #closed loop
    # 系统
    poleArray = control.poles(sys)
    plt.scatter(poleArray[0].real,poleArray[0].imag)
    plt.scatter(poleArray[1].real,poleArray[1].imag)
    plt.scatter(poleArray[2].real,poleArray[2].imag)

plt.title("Simulation")  # 括号当中输入标题的名称
# plt.scatter(X,Y)
plt.legend(loc='best')  # 图列位置，可选best，center等
plt.xlabel('Real')
plt.ylabel('Imaginary')
plt.show()
